<?php
	include "../head.php";
	session_start();
?>

<head>
	<meta charset="utf-8" />
	<link rel="stylesheet" type="text/css" href="DONE.css">
	<title>YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证</title>
</head>
<body>
	<center>
	<div id="tiaotiao">
	<b size="15px">查看购物车&nbsp;&nbsp;&nbsp;&nbsp;填写订单&nbsp;&nbsp;&nbsp;&nbsp;NOW-确认订单-</b>
	<br/>(<b size="5px">快点确认吧</b>)
	</div><br/>
	<div id="wz">
	<b size="8px">请您确认订单!</b>
	</div>
	<hr width="80%"><br/>
	<div id="bag"> 
	  <img src="56ea3c5d39a73744.JPG!600x600.jpg">
	</div>
	<h3>订单确认</h3>
	<form action="orderaction.php?a=add" method="post" >
			<table width="320" border="0" cellpadding="4">
				<tr>
					<td align="right">收件人：</td>
					<td><input type="text" name="linkman" readonly value="<?php echo $_POST['linkman']; ?>" style="border:0px;"/></td>
				</tr>
				<tr>
					<td align="right">地址：</td>
					<td>
						<input type="text" name="address" readonly value="<?php echo $_POST['address']; ?>" style="border:0px;"/>
					</td>
				</tr>
				<tr>
					<td align="right">邮编：</td>
					<td>
						<input type="text" name="code" readonly value="<?php echo $_POST['code']; ?>" style="border:0px;"/>
					</td>
				</tr>
				<tr>
					<td align="right">电话：</td>
					<td><input type="text" name="phone" readonly value="<?php echo $_POST['phone']; ?>" style="border:0px;"/></td>
				</tr>
				<tr>
					<td colspan="2" align="center">					
						<input type="submit" value="确认提交"/>&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="button" onclick="window.history.back();" value="返回"/>
					</td>
					
				</tr>
			</table>


	
	<h3>商品确认</h3>
	<table width="800px"  border="1px">
		<tr>
			<th>商品名称</th>
			<th>图片</th>
			<th>单价</th>
			<th>购买数量</th>
			<th>小计</th>
			
			
		</tr>
		<?php
			//查看购物车里面的商品 查看session
			// echo "<pre>";
			// print_r($_SESSION['goods']);
			$sum = 0;
			if($_SESSION['goods']){
			foreach($_SESSION['goods'] as $k=>$v){
				echo "<tr>";
				echo "<td>{$v['goods']}</td>";
				echo "<td><img src='../../../public/uploads/s_{$v['picname']}'></td>";
				echo "<td>{$v['price']}</td>";
				echo "<td>{$v['num']}</td>";
				echo "<td>".($v['num']*$v['price'])."</td>";
				echo "</tr>";

				$sum += $v['num']*$v['price'];
			}
			}
			$_SESSION['total'] = $sum ;

		?>
		<tr>
			<td>总计: </td><td colspan="5"><?php  echo $_SESSION['total']."元";?></td>
		</tr>
	</table>
	</form>
</body>
</html>
	
	
	
	</center>
	
	<div id="foot">
		<a href="#"><img src="hkinczio.jpg"></a>
	</div>
</body>